package Timer;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-08-08
 * Time：11:36
 */
public class Test {
    public static void main(String[] args) {

        Timer t1 = new Timer();

        t1.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("t1运行中...");
            }
        }, 2000);

        t1.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("t2运行中...");
            }
        }, 1000);

    }
}
